import {} from 'react'
import { Col } from 'antd'
import { FileSchema } from '@src/components/schema/fileSchema'
import style from './index.module.less'
import { download } from '@js/downloadRename'

interface Props {
  list: FileSchema[]
}

function Main ({ list }: Props) {
  if (list.length === 0) {
    return <div />
  }
  return (
    <Col span={8}>
      <div className={style['basic-cell']}>
        <div className={style['basic-cell-label']}>已签名文件：</div>
        <div className={style['basic-cell-text']}>
          {
            list.map((li, i) => {
              const name = li.original_filename || li.filename
              return <a className={style.link} onClick={() => download(li.path, name)} key={i}>{name}</a>
            })
          }
        </div>
      </div>
    </Col>
  )
}

export default Main
